Fix to update the file chooser entry
authorEmmanuele Bassi <ebassi@src.gnome.org>
Wed, 30 May 2007 12:27:47 +0000 (12:27 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Wed, 30 May 2007 12:27:47 +0000 (12:27 +0000)
Return after setting the file chooser entry instead of falling through. Also
remove the handling for the search and recent files operation modes, since
they don't have a location entry to update.

svn path=/trunk/; revision=17983

ChangeLog
gtk/gtkfilechooserdefault.c

index 9a3838cc9f8fc438169b8bb711896bf30753cbbf..cda28fe76c1743d6f14efd53d368e681ca09719a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-05-30  Emmanuele Bassi  <ebassi@gnome.org>
+
+       * gtk/gtkfilechooserdefault.c (update_chooser_entry): Return
+       after setting the file chooser entry with the current selection.
+
 2007-05-30  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkiconcachevalidator.c: Correct the handling
index 5daafabc5e2edd4dd45399a54f712a9cf4be44e8..9a9a4b27ed2fc3034698fa4694477172b6dac6b1 100644 (file)
@@ -6702,6 +6702,7 @@ update_chooser_entry (GtkFileChooserDefault *impl)
   struct update_chooser_entry_selected_foreach_closure closure;
   const char *file_part;
 
+  /* no need to update the file chooser's entry if there's no entry */
   if (impl->operation_mode == OPERATION_MODE_SEARCH ||
       impl->operation_mode == OPERATION_MODE_RECENT ||
       !impl->location_entry)
@@ -6761,20 +6762,7 @@ update_chooser_entry (GtkFileChooserDefault *impl)
            _gtk_file_chooser_entry_set_file_part (GTK_FILE_CHOOSER_ENTRY (impl->location_entry),
                                                    impl->browse_files_last_selected_name);
 
-        }
-      else if (impl->operation_mode == OPERATION_MODE_SEARCH)
-        {
-          search_get_valid_child_iter (impl, &child_iter, &closure.first_selected_iter);
-          gtk_tree_model_get (GTK_TREE_MODEL (impl->search_model), &child_iter,
-                              SEARCH_MODEL_COL_DISPLAY_NAME, &file_part,
-                              -1);
-        }
-      else if (impl->operation_mode == OPERATION_MODE_RECENT)
-        {
-          recent_get_valid_child_iter (impl, &child_iter, &closure.first_selected_iter);
-          gtk_tree_model_get (GTK_TREE_MODEL (impl->recent_model), &child_iter,
-                              RECENT_MODEL_COL_DISPLAY_NAME, &file_part,
-                              -1);
+          return;
         }
     }
   else
@@ -10479,7 +10467,6 @@ list_selection_changed (GtkTreeSelection      *selection,
 
  out:
 
-  /* TODO - Change the following functions to make them accept MODE_SEARCH */
   if (impl->location_entry)
     update_chooser_entry (impl);